<?php
// 本类由系统自动生成，仅供测试用途
class IndexAction extends HomeAction {

    public function index(){

        $this->header();	//导入页头
        $this->assign('value','index');
        $this->display();

    }

    public function page(){
        $this->header();    //导入页头并返回所有顶级栏目ID和栏目名
        $id=$this->_get("id");     //栏目ID

        $menu=M('Menu');           //栏目表
        //返回值：tpl=模板名,catid=内容模型ID，type=是否封面设计,name=当前栏目名
        $type=$menu->where(array('typeid'=>$id))->field('name,seotitle,keywords,description,tpl')->find(); 
        $this->assign('typename',$type['name']);
        $this->assign('seotitle',$type['seotitle']);
        $this->assign('keywords',$type['keywords']);
        $this->assign('description',$type['description']);

        $this->display($type['tpl']);
    }

}
